package com.sc.nft.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.UserAssets;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sc.nft.entity.vo.UserAssetsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
 * (sc_user_assets)数据Mapper
 *
 * @author kancy
 * @since 2022-06-01 15:02:32
 * @description 由 Mybatisplus Code Generator 创建
*/
@Mapper
public interface UserAssetsMapper extends BaseMapper<UserAssets> {

    Page<UserAssetsVO> pageUserAssetsList(Page page, @Param("userUuid") String userUuid, @Param("nickName") String nickName,@Param("userId") Long userId);

    /**
     * 扣减积分
     * @param userId
     * @param tokenNum
     * @return
     */
    boolean subTokenNumByUserId(@Param("userId") Long userId, @Param("tokenNum")BigDecimal tokenNum);
}
